﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Filter;
using COFE.Core.Utils;

namespace COFE.Core.Filter
{
    public interface IEntryFilterGenerator
    {        
        IEntryFilter[] GenerateFilters(IFileSystemInfo entry);
    }

    public static class IEntryFilterGeneratorExtension
    {
        public static Guid GetId(this IEntryFilterGenerator gen, IFileSystemInfo entry)
        {
            return 
                StringUtils<IFilter>.GetDeterministicGuid(
                COFEShared.FilterParser.FilterToFilterString(
                gen.GenerateFilters(entry)));
        }    
    }
}
